%datafromampl
%for 0.5
% 1  -1.32752
% 2   1.30077
% 3   2.26524
%for .25
% 1  -0.830838
% 2   1.52094
% 3   2.32115
%for 0.2
% 1  -0.719938
% 2   1.59735
% 3   2.31569
% Plot of the training and the test points and the new line
mn = -1.59/2.32;    cn = 0.71/2.32; % m = -b2/b3, c = -b1/b3                    
ytn = mn*xt +cn;
plotrequired = 1;
if(plotrequired==1)
    figure; hold on;
    pos = find(trainingdata(:,3)==1);
    plot(trainingdata(pos,1),trainingdata(pos,2),'g.');
    pos = find(trainingdata(:,3)==-1);  hold on; 
    plot(trainingdata(pos, 1),trainingdata(pos, 2),'y.');
    pos = find(testdata(:,3)==1);
    plot(testdata(pos,1),testdata(pos,2),'go');
    pos = find(testdata(:,3)==-1);  hold on; 
    plot(testdata(pos, 1),testdata(pos, 2),'mo');
    plot(xt,yt,'r');
    plot(xt,ytn,'b')
    axis([-3 3 -3 3]);                  hold off;
end